<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>支付表对应保单列表</title>
    <style type="text/css">
        .searchArea .fieldBox .label{width: 70px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;}
    </style>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>

<body class="iframeBody">
<div class="Wrapper">
    <div id="ligergrid1" class="sq-grid"></div>
</div>

<script type="text/javascript">
    var grid = null;
    $(function () {
        grid = $("#ligergrid1").ligerGrid({
            url: '<%=path%>/insurance/insPlcBscInfo/initPlcList.do?paySchId=${paySchId}',
            method: 'get',
            columns: [
                {display: '客户名称', name: 'cstNm', minWidth: 100, align: 'left', enabledSort: false,
                    render:function(rowdata,rowindex,value){
                        return '<a href="javascript:;" onclick="showCstDtl('+rowdata.cstId+')"><span class="gridTip" title="客户查看">'+rowdata.cstNm+'</span></a>';
                    }
                },
                {display: '保单号', name: 'plcNo', minWidth: 100, align: 'left', enabledSort: false,
                    render:function(rowdata,rowindex,value){
                        if(!value||value==null||value=='null'){
                            return '<a href="javascript:;" onclick="queryPlcDtl('+rowdata.id+')">保单</a>';
                        }
                        return '<a href="javascript:;" onclick="queryPlcDtl('+rowdata.id+')"><span class="gridTip" title="保单查看">'+rowdata.plcNo+'</span></a>';
                    }
                },
                {display: '保险种类', name: 'insTypCdNm', minWidth: 100, align: 'center', enabledSort: false},
                {display: '保险公司', name: 'insCompNm', minWidth: 100, align: 'left', enabledSort: false},
                /*{display: '保险支公司', name: 'insCompSubNm', minWidth: 100, align: 'left', enabledSort: false},*/
                {display: '购买方式', name: 'buyWayCdNm', minWidth: 100, align: 'left', enabledSort: false},
                {display: '被保险人', name: 'insPerNm', minWidth: 100, align: 'left', enabledSort: false},
                 {display: '保费总金额', name: 'insTtlFee', minWidth: 100, align: 'right', enabledSort: false,
                    render:function(rowdata,rowid,value){
                        return '&yen;'+FormatMoney(rowdata.insTtlFee/100);
                    }
                 },
                {display: '保单状态', name: 'plcStsCdNm', minWidth: 100, align: 'center', enabledSort: false},
                /*{display: '起保时间', name: 'plcBgTm', minWidth: 100, align: 'left', enabledSort: false,render: renderDate },*/
                {display: '止保时间', name: 'plcEndTm', minWidth: 100, align: 'left', enabledSort: false,render: renderDate},
                {display: '保单性质', name: 'plcPropCdNm', minWidth: 100, align: 'center', enabledSort: false},
            ],
            usePager: false,
            root: 'rows',
            record: 'total',
            hideLoadButton: true,
            width: '100%',
            height: '100%',
            heightDiff: -2,
            checkbox: false,
            rownumbers: true,
            allowUnSelectRow: true,
            alternatingRow:true
        });
        grid.setHeight(100);

        $("#pageloading").hide();

    });

    //查询客户详情
    function showCstDtl(_cstId){
        Add_navTab("InsPlcCstBscInfo_"+_cstId, "客户信息", '<%=path%>/customer/cstbscinfo/toCustDetailPage.do?id='+_cstId, null);
    }

    //查询保单详情
    function queryPlcDtl(_id){
        Add_navTab('InsPlcBscInfo_DTL_'+_id, "保单详情", '<%=path%>/insurance/insPlcBscInfo/toDetailPage.do?id='+_id, null);
    }

    //格式化时间
    function renderDate(rowdata, index, value) {
        var dateStr = "";
        if (null != value) {
            var date = new Date(value);
            dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD);
        }
        return dateStr;
    }

</script>

</body>
</html>
